package com.xx.book.common.exception;

import com.xx.book.common.response.ResponseEnum;
import lombok.Getter;

/**
 * @author 邢晨旭
 * {@code @date} 2023/10/12
 */
@Getter
public class MallException extends RuntimeException {

    private final ResponseEnum responseEnum;

    public MallException(String message) {
        super(message);
        this.responseEnum = ResponseEnum.ERROR;
    }

    public MallException(ResponseEnum responseEnum) {
        super(responseEnum.getMessage());
        this.responseEnum = responseEnum;
    }

}
